/**
 * Created by maxiaoqiang on 2018/7/6.
 */
import React, {Component} from "react";

import { Tabs } from 'antd';

import ChapterExam from "./ChapterExam";
import PastPaper from "./PastPaper";
import BetPaper from "./BetPaper";

import "./index.less";
const TabPane = Tabs.TabPane;

class  QuestionBank extends Component{
    constructor(props) {
        super(props);
        const panes = [
            { title: '章节题库', content: <ChapterExam/>, key: '1' ,closable: false}
            // { title: '真题题库', content: <PastPaper/>, key: '2' ,closable: false},
            // { title: '押题题库', content: <BetPaper/>, key: '3' ,closable: false}
        ];
        this.state = {
            activeKey: panes[0].key,
            panes
        };
    }

    onChange = (activeKey) => {
        this.setState({ activeKey });
    };

    render() {
        return (
            <div>
                <Tabs
                    onChange={this.onChange}
                    activeKey={this.state.activeKey}
                    type="card"
                >
                    {this.state.panes.map(pane => <TabPane tab={pane.title} key={pane.key}>{pane.content}</TabPane>)}
                </Tabs>
            </div>
        );
    }
}

export default QuestionBank;